import Vue from 'vue'

import { Tabbar, TabbarItem, NavBar, Lazyload, Cell, CellGroup, Button, Icon, Grid, GridItem, Toast, Field,Popup,Picker,Form,Dialog,Overlay} from 'vant';
import { Image as VanImage } from 'vant';
import'@/assets/font/iconfont.css'

//遮罩层
Vue.use(Overlay)
//弹出层
Vue.use(Dialog);
//表单
Vue.use(Form);
//选择器
Vue.use(Picker);
//弹出层
Vue.use(Popup)
//输入框
Vue.use(Field);
//提示
Vue.use(Toast);
//宫格
Vue.use(Grid);
Vue.use(GridItem);
//图标
Vue.use(Icon);
//按钮
Vue.use(Button);
//单元格
Vue.use(Cell);
Vue.use(CellGroup);
//导航栏
Vue.use(NavBar);
//图片
Vue.use(VanImage);
//懒加载
Vue.use(Lazyload, {
    lazyComponent: true,
});
//表单
Vue.use(Tabbar);
Vue.use(TabbarItem);


// 函数防抖
export function debounce(fn, t=300) {
    let timer = null;
    return function (...arg) {
      clearTimeout(timer);
      timer = setTimeout((v) => {
        fn.apply(this, arg);
      }, t);
    };
  }

